//
//  WriteFormViewController.h
//  MoneyBook
//
//  Created by Justin Kim on 11. 6. 28..
//  Copyright 2011 Daum. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Constants.h"
#import "ItemPickerViewController.h"
#import "ShopPickerViewController.h"
#import "PayPickerViewController.h"
#import "DayPickerViewController.h"
#import "TagPickerViewController.h"
#import "SQLHandler.h"
#import "CommonUtil.h"

enum {
	CELL_TITLE,
    CELL_ITEM,
    CELL_ACCOUNT,
    CELL_SHOP,
    CELL_PAY,
    CELL_WRITE_DAY,
    CELL_REPEAT,
    CELL_TAG
};
typedef NSUInteger CellType;


@interface WriteFormViewController : UITableViewController <UITableViewDataSource, UITableViewDelegate, UITextFieldDelegate, UIPickerViewDelegate> {
    
    NSArray* _dataSourceArray;
    NSMutableDictionary* _writeDic;
    
    UITextField* _titleTextField;
    
    UIButton* _itemBtn;

    UITextField* _accountTextField;
    UISegmentedControl* _accountSegment;
    UISegmentedControl* _accountSegment2;
    
    UITextField* _shopTextField;
    UIButton* _shopSearchButton;
    
    UILabel* _payLabel;
    UISegmentedControl* _payTypeSegment;
    
    UIButton* _writeDayButton;
    
    UISegmentedControl* _repeatSegment;

    UITextField* _tagTextField;
    UIButton* _tagSearchButton;
    
    ItemPickerViewController* _itemPickerViewController;
    ShopPickerViewController* _shopPickerViewController;
    DayPickerViewController* _dayPickerViewController;
    PayPickerViewController* _payPickerViewController;
    TagPickerViewController* _tagPickerViewController;
}
@property (nonatomic, retain) NSMutableDictionary* writeDic;
@property (nonatomic, retain) NSArray* dataSourceArray;

@property (nonatomic, retain) UITextField	*titleTextField;

@property (nonatomic, retain) UIButton* itemBtn;

@property (nonatomic, retain) UITextField* accountTextField;
@property (nonatomic, retain) UISegmentedControl* accountSegment;
@property (nonatomic, retain) UISegmentedControl* accountSegment2;

@property (nonatomic, retain) UITextField* shopTextField;
@property (nonatomic, retain) UIButton* shopSearchButton;

@property (nonatomic, retain) UILabel* payLabel;
@property (nonatomic, retain) UISegmentedControl* payTypeSegment;

@property (nonatomic, retain) UIButton* writeDayButton;

@property (nonatomic, retain) UISegmentedControl* repeatSegment;

@property (nonatomic, retain) UITextField* tagTextField;
@property (nonatomic, retain) UIButton* tagSearchButton;

@property (nonatomic, retain) ItemPickerViewController* itemPickerViewController;
@property (nonatomic, retain) ShopPickerViewController* shopPickerViewController;
@property (nonatomic, retain) DayPickerViewController* dayPickerViewController;
@property (nonatomic, retain) PayPickerViewController* payPickerViewController;
@property (nonatomic, retain) TagPickerViewController* tagPickerViewController;
@end
